<html>
<head>
    <title>
        Dictionary [name need here]
    </title>
    <meta name="layout" content="main"/>
</head>
<body>
<h1>Dictionary: ${session.dicName}</h1>

<div class="nav" role="navigation">
    <ul>
        <li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
        <li><g:link class="list" action="dicList">All Dictionaries</g:link></li>
        <li><g:link class="create" action="create">New Entry</g:link></li>
        <li><g:link class="create" action="importent">Import</g:link></li>
    </ul>
</div>

<table>
    <thead>
    <tr>
        <g:sortableColumn property="id" title="id"/>
        <g:sortableColumn property="phrase" title="Phrase"/>
        <g:sortableColumn property="translate" title="Translate"/>
        <g:sortableColumn property="wrong" title="Wrong answers"/>
        <g:sortableColumn property="right" title="Right answers"/>
    </tr>
    </thead>
    <tbody>
    <g:each in="${entries}" var="entry">
        <tr>
            <td>
            <div class="postText">
                <g:link action="show" id="${entry.id}">${entry.id}</g:link>
            </div>
            </td>
            <td>
            <div class="postText">
                ${entry.phrase}
            </div>
            </td>
            <td>
            <div class="postText">
                ${entry.translate}
            </div>
            </td>
            <td>
            <div class="postText">
                <g:if test="${entry.wrong != 0}">
                    ${entry.wrong}
                </g:if>
            </div>
            </td>
            <td>
            <div class="postText">
                <g:if test="${entry.right != 0}">
                    ${entry.right}
                </g:if>
            </div>
            </td>
        </tr>
    </g:each>
    </tbody>
</table>
<g:form>
    <fieldset class="buttons">
        <g:actionSubmit class="delete" action="deleteAll" value="Delete dictionary" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
    </fieldset>
</g:form>
</body>
</html>